Skip to main content

12.4 Obtain the collection exchange rate (merchant-defined exchange rate)

#Brief description: Get the merchant’s custom exchange rate interface (merchant’s custom exchange rate)

Query parameters

Parameter nameTypeRequiredParameter meaningParameter description
keystringYesMerchant keyapiKey
currencystringYesCurrency (order currency)Example: CNY
userCurrencystringYesUser’s actual received currencyExample: USDT
signstringYesmd5 signatureFor details, see Signature Algorithm (Document 2)
Request json sample
{
"key": "9yUreYgTRtit39Dy",
"currency": "CNY",
"userCurrency": "USDT",
"sign":"dbc72adf640a82e0b21f98c50afb2881"
}

Return value

Parameter nameTypeParameter meaningParameter description
codeintRequest statusCommunication status Successful return: 0, others indicate failure
successbooleanSuccess Statustrue Success
messagestringDescription
datajsonParametersPlease refer to the following description for parameters
Return to Example
{  
    "code": 0,
    "success": true,
    "message": null,
    "data": {
      "baseCurrency": "USDT",
      "quoteCurrency": "CNY",
      "tradePair": "USDT/CNY",
      "rate": 6.37,
      "costRate": 6.37,
      "costReverseRate": 0.15698587127158556,
      "exchangeAction": "SELL",
      "quoteExpression": "1USDT≈6.37CNY",
      "baseAmount": "15.698587",
      "quoteAmount": "100"
    }
}
data parameter description
Parameter nameTypeParameter meaningParameter description
baseCurrencystringBase Currency
quoteCurrencystringQuote Currency
tradePairstringTrading Pair
ratestringPrice
costRatenumberCalculate price ( FROM x rate = TO )
costReverseRatenumberCalculate the price in reverse (TO x rate = FROM )
exchangeActionenumTransaction TypeBUY:Buy| SELL: Sell
quoteExpressionstringExchange rate expressionExpression in quotation form
baseAmountstringBase AmountExample Base Amount
quoteAmountstringQuotation amountSample quotation amount